package com.kcl.dfss;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class HistoryDeviceMessage extends Activity {

	private LinearLayout hdmessage_back;
	private ListView list_message;
	private String[] title = new String[]{"设备名称","安装车辆类型","ROM版本"};
	private String[] content = new String[]{"XCamera","别克 君越","1.0.0"};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_hdmessage);
		
		hdmessage_back = (LinearLayout) findViewById(R.id.hdmessage_back);
		hdmessage_back.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		List<Map<String, String>> listItems = new ArrayList<Map<String,String>>();
		for(int i=0;i<title.length;i++){
			Map<String, String> listItem = new HashMap<String, String>();
			listItem.put("title", title[i]);
			listItem.put("content", content[i]);
			listItems.add(listItem);
		}
		SimpleAdapter simpleAdapter = new SimpleAdapter(HistoryDeviceMessage.this, listItems, R.layout.device_item2,
				new String[]{"title","content"}, new int[]{R.id.text_deviceID,R.id.text_deviceno});
		list_message = (ListView) findViewById(R.id.list_message);
		list_message.setAdapter(simpleAdapter);
	}

}
